
import { reqmemberlist } from '../../request/api'
const state = {
    list: [],
    size: 2,
    count: 0,
    page: 1
}

const getters = {
    list(state) {
        return state.list
    },
    size(state) {
        return state.size
    },
    count(state) {
        return state.count
    },
    page(state) {
        return state.page
    }
}

const mutations = {
    changeList(state, list) {
        state.list = list
    },
    changeSize(state, size) {
        state.size = size
    },
    changeCount(state, count) {
        state.count = count
    },
    changePage(state, page) {
        state.page = page
    },
}

const actions = {
    reqList({ commit }) {
        reqmemberlist().then(res => {
            if (res.data.code === 200) {
                commit('changeList', res.data.list)
            }
        })
    }

}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}